package com.xb.loan.fund.service.bean;


import com.xb.loan.fund.service.IFundService;
import com.xb.loan.fund.service.constant.FundConst;

import java.util.HashMap;
import java.util.Map;

public class EncashResultVO extends AbstractCashierResult {
	private static final long serialVersionUID = -8642395087683236401L;
	private String encashId;// 提现订单ID
	
	
	/**
     * 根据returnCode返回码，获取真正的返回结果
     * @return
     * 2015年9月7日 by zhangyi
     */
    public int generateResult(){
        Map<String,Integer> map = new HashMap<String,Integer>();
        
        map.put("1", FundConst.ChargeStatus_Success);
        map.put("2", FundConst.ChargeStatus_Fail);
        if(this.getReturnCode() == null){
            this.setReturnCode("");
        }
        return map.get(this.getReturnCode());
    }
    
    public static void main(String[] args){
        new EncashResultVO().generateResult();
    }
    /**
     * 
     *  生成秘钥的顺序   提现订单ID+平台ID+用户ID+渠道ID +充值金额+充值结果
     * @return
     * 2015年9月7日 by wuqinglong
     */
    public String generateKey(){
        StringBuffer sb = new StringBuffer();
        String strCentor = FundConst.Encrypt_Field_Splitter;
        sb.append(this.getEncashId());
        sb.append(strCentor);
        sb.append(this.getPlatId());
        sb.append(strCentor);
        sb.append(this.getUserId());
        sb.append(strCentor);
        sb.append(IFundService.df.format(this.getMoney()));
        sb.append(strCentor);
        sb.append(this.getReturnCode());
        
        return sb.toString();
    }

	public String getEncashId() {
		return encashId;
	}

	public void setEncashId(String encashId) {
		this.encashId = encashId;
	}
}
